import QtQuick 1.1
import com.nokia.meego 1.0

Sheet {
    id: sheet

    acceptButtonText: "Add"
    rejectButtonText: "Cancel"

    content: Column {
        anchors.fill: parent
        anchors.leftMargin: 10
        anchors.topMargin: 10
        spacing: 10

        Label {
            text: "Add New Device"
            platformStyle: LabelStyle {
                fontPixelSize: 40
            }
        }

        Label {
            text: "Name"
            platformStyle: LabelStyle {
                fontPixelSize: 20
                textColor: "gray"
            }
        }

        TextField {
            id: nameEntry
            anchors.margins: 16
            anchors.left: parent.left
            anchors.right: parent.right
        }

        Label {
            text: "IP Address"
            platformStyle: LabelStyle {
                fontPixelSize: 20
                textColor: "gray"
            }
        }

        TextField {
            id: ipEntry
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.margins: 16
            placeholderText: qsTr("0.0.0.0")
        }
    }

    onAccepted: {
        appWindow.devices.addDevice(nameEntry.text, ipEntry.text)
        nameEntry.text = ""
    }
}
